package com.gosuncn.config;

import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry;
import org.springframework.web.servlet.config.annotation.ViewControllerRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

/***
 *功能描述
 * @author zxl
 * @date 2021/7/26
*/
@Configuration
public class MyMvcConfig implements WebMvcConfigurer {

    /***
     *试图跳转
    */
    @Override
    public void addViewControllers(ViewControllerRegistry registry) {
        registry.addViewController("/").setViewName("index");
    }

//    @Override
    public void addResourceHandlers(ResourceHandlerRegistry registry) {
        registry.addResourceHandler("/hello/**").addResourceLocations("file:D:/IdeaProject/demo1/target/classes//static/files/2021-08-26/");
    }
}
